﻿@{
    Layout = "_Layout_pop";
}

@section scripts{
    <script src="~/Playground/Plugin/distpicker/distpicker.data.js"></script>
    <script src="~/Playground/Plugin/distpicker/distpicker.js"></script>
    <script type="text/javascript">
        var acceptClick;
        var bootstrap = function ($, ibpm) {
            "use strict";
            var P_province;
            var P_city;
            var P_district;
            var page = {
                init: function () {
                    if (!!parent) {
                        if (!!parent.P_province)
                            P_province = parent.P_province;
                        else
                            P_province = '---- 选择省 ----';

                        if (!!parent.P_city)
                            P_city = parent.P_city;
                        else
                            P_city = '---- 选择市 ----';

                        if (!!parent.P_district)
                            P_district = parent.P_district;
                        else
                            P_district = '---- 选择区 ----';
                    }
                    $('#distpicker').distpicker({
                        autoSelect: false,
                        province: P_province,
                        city: P_city,
                        district: P_district
                    });
                },
            };
            // 保存数据
            acceptClick = function (callBack) {
                var postData = $('#form').ibpm_GetFormData();
                if (!!callBack) {
                    callBack(postData);
                }
                return true;
            };
            page.init();
        }
    </script>
}
<form id="form" class="form-inline">
    <div id="distpicker" style="display:flex; margin:10px;">
        <div class="form-group" style="margin-right:10px;">
            <label class="sr-only" for="province">Province</label>
            <select class="form-control" id="province"></select>
        </div>
        <div class="form-group" style="margin-right:10px;">
            <label class="sr-only" for="city">City</label>
            <select class="form-control" id="city"></select>
        </div>
        <div class="form-group" style="margin-right:10px;">
            <label class="sr-only" for="district">District</label>
            <select class="form-control" id="district"></select>
        </div>
    </div>
</form>